from launch import LaunchDescription  
from launch_ros.actions import ComposableNodeContainer  
from launch_ros.descriptions import ComposableNode  
  
def generate_launch_description():  
    ld = LaunchDescription()  
      
    # 创建一个ComposableNodeContainer实例  
    container = ComposableNodeContainer(  
        name="my_container", 
        namespace="",  
        package="rclcpp_components",  
        executable="component_container",  
        composable_node_descriptions=[  
            ComposableNode(  
                package="components_cpp",  
                plugin="my_namespace::NumberPubNode",  
                name="number_publisher_1"  
            ),  
            ComposableNode(  
                package="components_cpp",   
                plugin="my_namespace::NumberPubNode",  
                name="number_publisher_2"  
            ),  
            ComposableNode(  
                package="components_cpp",   
                plugin="my_namespace::NumberPubNode",  
                name="number_publisher_3"  
            ) 
        ] 
    )  
      
    # 将ComposableNodeContainer添加到LaunchDescription中  
    ld.add_action(container)   
      
    return ld